<?if(User::is_logged()):?>
<?$log=1;?>
<?$user_id=$_SESSION['user_id'];?>
<?$manage_request= Group::check_permission_user($user_id,'manage_request','index');?>
<?$manage_solution= Group::check_permission_user($user_id,'manage_solution','index');?>
<?$manage_device= Group::check_permission_user($user_id,'manage_device','index');?>
<?$manage_configuration= Group::check_permission_user($user_id,'manage_configuration','index');?>
<?$manage_customer= Group::check_permission_user($user_id,'manage_customer','index');?>
<?$manage_warranty= Group::check_permission_user($user_id,'manage_warranty','index');?>
<?$administration= Group::check_permission_user($user_id,'administration','index');?>
<?else:?>     
    <?$log=0;?>
   <?header('Location: http://localhost:8080/servicedeskG');?>
<?endif?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title><?=WEBSITE_NAME?> - Service Desk</title>
<meta name="description" content="ServiceDesk" />
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="description" content="<?=$view['meta']['description']?>" />
<meta name="keywords" content="<?=$view['meta']['keywords']?>"/>
<link rel="stylesheet" href="themes/style.css"/>
<link rel="stylesheet" href="themes/menu.css"/>
<script type="text/javascript" src="<?=WEBSITE_URL?>/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<?=WEBSITE_URL?>/js/jquery.modal/jquery.modal.min.js"></script>
<link rel="stylesheet" href="<?=WEBSITE_URL?>/js/jquery.modal/jquery.modal.css"/>

<script type="text/javascript" src="<?=WEBSITE_URL?>/js/jquery.ui/jquery-ui.min.js"></script>
<link rel="stylesheet" href="<?=WEBSITE_URL?>/js/jquery.ui/jquery.ui.all.css"/>
<link rel="stylesheet" media="all" type="text/css" href="<?=WEBSITE_URL?>/js/jquery.ui/jquery-ui-timepicker-addon.css" />

</head>
<body>
<div id="header">
    <div class="page-wrapper">
        <div id="logo">
            <img src="themes/logo.png"/>
        </div>
        <div id="top-banner">
            <?if(User::is_logged()):?>
               <span>Hello </span><a href="index.php?m=users"><strong style="color:cyan"><?=SESSION_value('user_name','Guest')?></strong></a> <span>|</span> 
               <a href="<?=WEBSITE_URL?>/index.php?m=users&a=logout">Logout</a>
            <?else:?>     
               <?header('Location: http://localhost:8080/servicedesk');?>
            <?endif?>
            
        </div>
        <div id="top-nav">
            <ul class="tabrow">
                <li id="manage_request" <?if($m=='manage_request'):?>class='selected' <?endif?>><a href="index.php?m=manage_request">Requests</a></li>
                <li id="manage_solution" <?if($m=='manage_solution'):?>class='selected' <?endif?>><a href="index.php?m=manage_solution">Solutions</a></li>
                <li id="manage_device" <?if($m=='manage_device'):?>class='selected' <?endif?>><a href="index.php?m=manage_device">Assets</a></li>
                <li id="manage_configuration" <?if($m=='manage_configuration'):?>class='selected' <?endif?>><a href="index.php?m=manage_configuration">Configuration</a></li>
                <li id="manage_customer" <?if($m=='manage_customer'):?>class='selected' <?endif?>><a href="index.php?m=manage_customer">Customer</a></li>
                <li id="manage_warranty" <?if($m=='manage_warranty'):?>class='selected' <?endif?>><a href="index.php?m=manage_warranty">Warranty</a></li>

                <li id="administration" <?if($m=='administration'):?>class='selected' <?endif?> ><a href="index.php?m=administration" >Admin</a></li>
            </ul>     
        </div>
    </div>	
</div>

<div class="page-wrapper">    
    <?=$view['content']?>
    <!--
    <div id="left-menu">
        <p>Duis sodales fermentum dapibus. Donec iaculis nisi ut lacus feugiat sagittis. Sed velit elit, sagittis sed tortor ut, lobortis pretium lorem. Sed vestibulum dolor eu vehicula accumsan. Donec in condimentum mauris, sed ultrices turpis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer adipiscing ultricies massa vel convallis. Aenean aliquet erat ut eros dapibus, quis porta lacus semper. Ut eget nulla sit amet dolor pulvinar rhoncus. Proin vel hendrerit neque.</p>
    </div>
    <div id="right-content">
        <p>Duis sodales fermentum dapibus. Donec iaculis nisi ut lacus feugiat sagittis. Sed velit elit, sagittis sed tortor ut, lobortis pretium lorem. Sed vestibulum dolor eu vehicula accumsan. Donec in condimentum mauris, sed ultrices turpis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer adipiscing ultricies massa vel convallis. Aenean aliquet erat ut eros dapibus, quis porta lacus semper. Ut eget nulla sit amet dolor pulvinar rhoncus. Proin vel hendrerit neque.</p>
        <p>Mauris dapibus, risus eget ultrices fringilla, lorem orci viverra nibh, sit amet laoreet leo dui vel neque. Aenean ultrices varius placerat. Duis malesuada nisl non ante consectetur, sit amet malesuada est vehicula. Sed vehicula nisl sit amet ligula scelerisque ultricies. Duis posuere nisi in mi congue, sed egestas dui dictum. Morbi elementum semper nisl, vel commodo sapien pellentesque venenatis. Curabitur sed rutrum massa. Sed tincidunt eros eget hendrerit aliquet. Aenean in leo ac diam volutpat pharetra sed sed leo. Aliquam diam leo, convallis ac iaculis aliquet, egestas vel sem.</p>
    </div>
</div>
    
<div class="page-wrapper">    
    <div id="left-content">
        <p>Duis sodales fermentum dapibus. Donec iaculis nisi ut lacus feugiat sagittis. Sed velit elit, sagittis sed tortor ut, lobortis pretium lorem. Sed vestibulum dolor eu vehicula accumsan. Donec in condimentum mauris, sed ultrices turpis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer adipiscing ultricies massa vel convallis. Aenean aliquet erat ut eros dapibus, quis porta lacus semper. Ut eget nulla sit amet dolor pulvinar rhoncus. Proin vel hendrerit neque.</p>
        <p>Mauris dapibus, risus eget ultrices fringilla, lorem orci viverra nibh, sit amet laoreet leo dui vel neque. Aenean ultrices varius placerat. Duis malesuada nisl non ante consectetur, sit amet malesuada est vehicula. Sed vehicula nisl sit amet ligula scelerisque ultricies. Duis posuere nisi in mi congue, sed egestas dui dictum. Morbi elementum semper nisl, vel commodo sapien pellentesque venenatis. Curabitur sed rutrum massa. Sed tincidunt eros eget hendrerit aliquet. Aenean in leo ac diam volutpat pharetra sed sed leo. Aliquam diam leo, convallis ac iaculis aliquet, egestas vel sem.</p>
    </div>
    <div id="right-menu">
        <p>Duis sodales fermentum dapibus. Donec iaculis nisi ut lacus feugiat sagittis. Sed velit elit, sagittis sed tortor ut, lobortis pretium lorem. Sed vestibulum dolor eu vehicula accumsan. Donec in condimentum mauris, sed ultrices turpis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer adipiscing ultricies massa vel convallis. Aenean aliquet erat ut eros dapibus, quis porta lacus semper. Ut eget nulla sit amet dolor pulvinar rhoncus. Proin vel hendrerit neque.</p>
    </div>
</div>
        
    -->
    <div style="clear:both"></div>
<div class="page-wrapper">    
    <div id="footer">
    <b>&copy; 2013 Blah blah.</b>
    </div>
</div>
<script>
$(document).ready(function() {
    var loged=<?=$log?>;
    if(loged==1){
        var manage_request=<?=$manage_request?>;
        var manage_solution=<?=$manage_solution?>;
        var manage_device=<?=$manage_device?>;
        var manage_configuration=<?=$manage_configuration?>;
        var manage_customer=<?=$manage_customer?>;
        var manage_warranty=<?=$manage_warranty?>;
        var administration=<?=$administration?>;
        //alert(manage_request);
        if(manage_request==0) $('#manage_request').hide();
        if(manage_solution==0) $('#manage_solution').hide();
        if(manage_device==0) $('#manage_device').hide();
        if(manage_configuration==0) $('#manage_configuration').hide();
        if(manage_customer==0) $('#manage_customer').hide();
        if(manage_warranty==0) $('#manage_warranty').hide();
        if(administration==0) $('#administration').hide();
    }

});  
</script>
</body>
</html>